home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / include / Qt / qcursor.h.z / qcursor.h
Encoding:
C/C++ Source or Header  |  1998-10-28  |  3.3 KB  |  111 lines

  1. /****************************************************************************
  2. ** $Id: qcursor.h,v 2.4 1998/07/03 00:09:31 hanord Exp $
  3. **
  4. ** Definition of QCursor class
  5. **
  6. ** Created : 940219
  7. **
  8. ** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
  9. **
  10. ** This file is part of Qt Free Edition, version 1.40.
  11. **
  12. ** See the file LICENSE included in the distribution for the usage
  13. ** and distribution terms, or http://www.troll.no/free-license.html.
  14. **
  15. ** IMPORTANT NOTE: You may NOT copy this file or any part of it into
  16. ** your own programs or libraries.
  17. **
  18. ** Please see http://www.troll.no/pricing.html for information about 
  19. ** Qt Professional Edition, which is this same library but with a
  20. ** license which allows creation of commercial/proprietary software.
  21. **
  22. *****************************************************************************/
  23.  
  24. #ifndef QCURSOR_H
  25. #define QCURSOR_H
  26.  
  27. #ifndef QT_H
  28. #include "qpoint.h"
  29. #include "qshared.h"
  30. #endif // QT_H
  31.  
  32.  
  33. struct QCursorData;                // internal cursor data
  34.  
  35.  
  36. class QCursor                    // cursor class
  37. {
  38. public:
  39.     QCursor();                    // create default arrow cursor
  40.     QCursor( int shape );
  41.     QCursor( const QBitmap &bitmap, const QBitmap &mask,
  42.          int hotX=-1, int hotY=-1 );
  43.     QCursor( const QCursor & );
  44.    ~QCursor();
  45.     QCursor &operator=( const QCursor & );
  46.  
  47.     int          shape()   const;
  48.     void      setShape( int );
  49.  
  50.     const QBitmap *bitmap() const;
  51.     const QBitmap *mask()   const;
  52.     QPoint      hotSpot() const;
  53.  
  54.     HANDLE      handle()  const;
  55.  
  56.     static QPoint pos();
  57.     static void      setPos( int x, int y );
  58.     static void      setPos( const QPoint & );
  59.  
  60.     static void      initialize();
  61.     static void      cleanup();
  62.  
  63. private:
  64.     void      update() const;
  65.     QCursorData     *data;
  66. };
  67.  
  68.  
  69. inline void QCursor::setPos( const QPoint &p )
  70. {
  71.     setPos( p.x(), p.y() );
  72. }
  73.  
  74.  
  75. /*****************************************************************************
  76.   Cursor shape identifiers (correspond to global cursor objects)
  77.  *****************************************************************************/
  78.  
  79. enum QCursorShape {
  80.     ArrowCursor, UpArrowCursor, CrossCursor, WaitCursor, IbeamCursor,
  81.     SizeVerCursor, SizeHorCursor, SizeBDiagCursor, SizeFDiagCursor,
  82.     SizeAllCursor, BlankCursor, LastCursor=BlankCursor, BitmapCursor=24 };
  83.  
  84.  
  85. /*****************************************************************************
  86.   Global cursors
  87.  *****************************************************************************/
  88.  
  89. extern const QCursor arrowCursor;        // standard arrow cursor
  90. extern const QCursor upArrowCursor;        // upwards arrow
  91. extern const QCursor crossCursor;        // crosshair
  92. extern const QCursor waitCursor;        // hourglass/watch
  93. extern const QCursor ibeamCursor;        // ibeam/text entry
  94. extern const QCursor sizeVerCursor;        // vertical resize
  95. extern const QCursor sizeHorCursor;        // horizontal resize
  96. extern const QCursor sizeBDiagCursor;        // diagonal resize (/)
  97. extern const QCursor sizeFDiagCursor;        // diagonal resize (\)
  98. extern const QCursor sizeAllCursor;        // all directions resize
  99. extern const QCursor blankCursor;        // blank/invisible cursor
  100.  
  101.  
  102. /*****************************************************************************
  103.   QCursor stream functions
  104.  *****************************************************************************/
  105.  
  106. QDataStream &operator<<( QDataStream &, const QCursor & );
  107. QDataStream &operator>>( QDataStream &, QCursor & );
  108.  
  109.  
  110. #endif // QCURSOR_H
  111.